<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<title>title</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css" />
		<link rel="stylesheet" type="text/css" href="../css/public-head.css" />
		<link rel="stylesheet" href="../css/mui.css" />
		<link rel="stylesheet" type="text/css" href="../css/demo3_1.css" />
		<style>

		</style>
	</head>

	<body>
		<!-- 车位信息 -->
		<div id="carr_addres">

		</div>
		<!--<div class='box'>
			<div class='address'>
				<div class='car-type'>
					<div>
						<img src="../image/icon/kefutx@2x.png"/>
					</div>
					<div>
						<div class='car-number'>桂B666666</div>
						<div class='car-addr'>
							<div class='default'>默认</div>
							<div>万达青秀区</div>
						</div>
					</div>
				</div>
				<div class='edit' bindtap="deleteCar">删除</div>
			</div>
		</div>-->
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/public-head.js"></script>
	<script type="text/javascript" src="../script/mui.js"></script>
	<script src="../script/template-web.js"></script>
	<!--车辆地址模板-->
	<script type="text/html" id="car_list">
		{{each data value index}}
		<div class='box'>
			<div class='address'>
				<div class='car-type'>
					<div>
						<img src="../image/icon/kefutx@2x.png" />
					</div>
					<div>
						<div class='car-number'>{{value.car_number}}</div>
						<div class='car-addr'>
							<div class='default'>默认</div>
							<div>{{value.area}}</div>
						</div>
					</div>
				</div>
				<div class='edit' onclick="deleteCar(value)">删除</div>
			</div>
		</div>
		{{/each}}
	</script>
	<!--暂时没有记录-->
	<script type="text/html" id="nullShop">
		<div class='noorder'>
			<div>
				<image src='https://ccx-mini.oss-cn-shenzhen.aliyuncs.com/static/orders/noorder.png'></image>
			</div>
			<h1>您还未在本店进行过消费</h1>
		</div>
	</script>
	<script type="text/javascript">
		//头部
		headInner({
			title: "历史地址",
			//headleft
			headl: '<a href="#" style="color:white" class="mui-icon mui-icon-left-nav" tapmode onclick="api.closeWin()"></a>',
			//headright
			headr: '<a style="color:white"></a>',
			color: "", //默认是蓝色
			padding: "0px 0px 0px",
		})

		var arr = {
			"data": [{
				area: "清秀万达银座",
				brand: null,
				brand_id: 0,
				brand_name: null,
				buy_date: null,
				car_logo: null,
				car_number: "桂A123456",
				car_type: {
					id: 1,
					name: "SUV"
				},
				created_at: "2019-05-11 11:45:18",
				deleted_at: null,
				engine_number: "",
				group_bind: 0,
				id: 1054,
				insurance_expired: null,
				is_default: 0,
				mileage: "0.00",
				mobile: "13978569621",
				model_name: null,
				type_id: 1,
				uid: 1041,
				updated_at: "2019-05-11 11:45:18",
				vin_code: null,
				year_check: null,
			}, {
				area: "清秀区万达银座",
				brand: null,
				brand_id: 0,
				brand_name: null,
				buy_date: null,
				car_logo: null,
				car_number: "桂A123456",
				car_type: {
					id: 1,
					name: "SUV"
				},
				created_at: "2019-05-11 14:50:33",
				deleted_at: null,
				engine_number: "",
				group_bind: 0,
				id: 1064,
				insurance_expired: null,
				is_default: 0,
				mileage: "0.00",
				mobile: "13978569621",
				model_name: null,
				type_id: 1,
				uid: 1041,
				updated_at: "2019-05-11 14:50:33",
				vin_code: null,
				year_check: null,
			}, {
				area: "青秀区万达银座",
				brand: null,
				brand_id: 0,
				brand_name: null,
				buy_date: null,
				car_logo: null,
				car_number: "桂B199991",
				car_type: {
					id: 1,
					name: "SUV"
				},
				created_at: "2019-05-11 15:28:17",
				deleted_at: null,
				engine_number: "",
				group_bind: 0,
				id: 1072,
				insurance_expired: null,
				is_default: 0,
				mileage: "0.00",
				mobile: "13978569621",
				model_name: null,
				type_id: 1,
				uid: 1041,
				updated_at: "2019-05-11 15:28:17",
				vin_code: null,
				year_check: null,
			}]
		}

		apiready = function() {
			carr_addres()
		};

		//汽车地址
		function carr_addres() {
			var html = template('car_list', arr);
			document.getElementById('carr_addres').innerHTML = html;
		}
		//删除按钮
		function deleteCar(data) {
			console.log("我点删除了")
			console.log(data)
		}
	</script>

</html>
